<template>
    <div class="transfer_success">
        <img src="@/assets/image/r3.png" alt="" class="status_img">
        <div class="status_text">{{ $t('chat.资金退还') }}</div>
        <div class="value">￥{{ transfer.amount }}</div>

        <div class="time">{{ $t('msg.转账时间') }} {{ formatTime(transfer.createtime) }}</div>
        <div class="time">{{ $t('msg.退款时间') }} {{ formatTime(transfer.receive_time) }}</div>
    </div>
</template>
<script>
import dayjs from 'dayjs'
export default {
    props: {
        id: {
            type: [Number, String],
            default: ""
        }
    },
    data() {
        return {
            transfer: {}
        };
    },
    async created() {
        let res = await this.$api.chatApi.transferDetail({
            transfer_id: this.id
        });
        this.transfer = res.transfer;
    },
    methods: {
        formatTime(timestamp) {
            return timestamp ? dayjs.unix(timestamp).format('YYYY-MM-DD HH:mm:ss') : 'N/A';
        }
    }
}
</script>

<style lang="scss" scoped>
.transfer_success {
    padding-bottom: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    .status_img {
        width: 72px;
        height: 72px;
    }

    .status_text {
        font-size: 18px;
        color: #333333;
        margin: 20px 0;
        text-align: center;
    }

    .value {
        font-size: 32px;
        color: #333333;
        margin-bottom: 72px;
    }


    .time {
        font-size: 14px;
        color: #333333;
        margin-bottom: 16px;
    }


}
</style>